"""
>>> Test.data, Test.prop # doctest: +ELLIPSIS
(['1'], <property object at 0x...)
>>> Test.prop != 'run' # 属性/方法
True
>>> Test.prop.setter, Test.prop2 # doctest: +ELLIPSIS
(<built-in method setter of property object at 0x...>, <property object at 0x...>)
>>> Test.data
['1']
>>> t = Test()
>>> t.prop != 'init run'
True
>>> vars(t) 
{'_prop': 'init prop', '_prop2': 'init prop2'}
>>> t.prop = 'setted'
>>> t.prop
'setted'
>>> Test.prop2.setter(lambda: '1232')
>>> t.prop2
'init prop2'
>>> Test.prop2 = Test.prop2.setter(lambda:'1232')
>>> t.prop2
'init prop2'
>>> help(Test)
>>> help(t)
"""


class Test:
    data = ["1"]
    prop = "class prop"  # 永远无法获取
    prop2 = "class prop"  # 永远无法获取

    def __init__(self):
        self._prop = "init prop"
        self._prop2 = "init prop2"
        # print(property, self.prop)
        # assert isinstance(property, property), "fuck"

    @property
    def prop2(self):
        return self._prop2

    @property
    def prop(self):
        return self._prop

    @prop.setter
    def prop(self, value):
        self._prop = value


if __name__ == "__main__":
    import doctest

    print("meta 测试开始")
    (ff, tt) = doctest.testmod()
    print("测试结束:统计-失败{},总计{}".format(ff, tt))
    print("√" * tt if tt > 0 and not ff else "无测试" if not ff else "×" * ff)
